<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>创建项目</title>
    <script type="text/javascript" th:src="@{/jquery/jquery-3.5.1.min.js}"></script>
    <script th:src="@{/layui/layui.js}"></script>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body>
[[${tid}]]

<form class="layui-form layui-form-pane">
    <h3>新建项目</h3>
    <p th:if="${!#strings.isEmpty(addfail)}" th:text="${addfail}"></p>
    <input type="hidden" id="tid" name="tenantid" th:value="${tid}">
    <input class="layui-text" id="Artname" type="text" name="Artname" placeholder="写个星星"><br>
    <div class="layui-form-item">
        项目图标
    </div>
    <div class="layui-form-item">
        <div style="border: solid 1px blue">
            <i class="layui-icon" style="font-size: 50px;padding: 0 50px;margin: auto">&#xe68c;</i>
            <i class="layui-icon" style="font-size: 50px;padding: 0 50px;margin: auto">&#xe68f;</i>
            <i class="layui-icon" style="font-size: 50px;padding: 0 50px;margin: auto">&#xe683;</i>
            <span class="layui-badge layui-bg-blue">蓝</span>
            <span class="layui-badge layui-bg-blue">蓝</span>
        </div> 
        
        
    </div>
    <input class="layui-btn-sm layui-btn-normal" type="button" value="创建" onclick="a1()">
    <input class="layui-btn-sm" type="button" value="取消" id="close">
</form>

<script>
    var layer ;
    layui.use('layer', function(){
        layer = layui.layer;
    });
    $('#close').click(function (){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })
    // 监听提交,
    // form.on('submit(add)',function (data) {
    //     var index = parent.layer.getFrameIndex(window.name);
    //     $.post('/function/invitation',data.field,function (data) {
    //         parent.layer.msg(data.msg);
    //         if (data.flat){
    //             parent.layer.close(index)
    //         }
    //     })
    // })

    function a1(){
        $.get({
            url:"/article/createArt",
            data:{'articleName':$("#Artname").val(),'tenantId':$('#tid').val()},
            success:function (data) {
                // alert(data.toString());
                //提交后重新加载页面
                window.parent.location.reload();
            }
        });
    }
    
</script>

</body>
</html>